package com.sanweibook.jhook.biz.sys.impl;

import com.sanweibook.jhook.biz.CrudService;
import com.sanweibook.jhook.biz.sys.SysMenuService;
import com.sanweibook.jhook.dal.dao.sys.SysMenuDao;
import com.sanweibook.jhook.dal.model.sys.SysMenu;
import com.sanweibook.jhook.dal.page.Page;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* Created by twg on 17/3/16.
*/
@Service
public class SysMenuServiceImpl extends CrudService<SysMenuDao,SysMenu> implements SysMenuService {

    @Override
    public void delete(SysMenu sysMenu) {
        delete(sysMenu,"sysMenu:*");
    }

    @Override
    public void deleteById(Long id) {
        deleteById(id,"sysMenu:*");
    }

    @Override
    public void deletedByIds(List<Long> ids) {
        deleteByIds(ids,"sysMenu:*");
    }

    @Override
    public SysMenu get(SysMenu sysMenu) {
        return get(sysMenu,"sysMenu:get");
    }

    @Override
    public SysMenu getById(Long id) {
        return getById(id,"sysMenu:getbyid");
    }

    @Override
    public void save(SysMenu sysMenu) {
        insert(sysMenu,"sysMenu:*");
    }

    @Override
    public void batchSave(List<SysMenu> sysMenu) {
        batchInsert(sysMenu,"sysMenu:*");
    }

    @Override
    public void update(SysMenu sysMenu) {
        update(sysMenu,"sysMenu:*");
    }

    @Override
    public int queryCount(SysMenu sysMenu) {
        return queryCount(sysMenu,"sysMenu:querycount");
    }

    @Override
    public List<SysMenu> queryAll(SysMenu sysMenu) {
        return queryAll(sysMenu,"sysMenu:queryall");
    }

    @Override
    public List<SysMenu> queryByIds(List<Long> ids) {
        return queryByIds(ids,"sysMenu:querybyids");
    }

    @Override
    public Page<SysMenu> queryByPages(SysMenu sysMenu) {
        return queryByPage(sysMenu);
    }
}
